import sys

class ProcessBar:
    def __init__(self, total):
        self.total = total
        self.next_target = 0.0

    def init(self, total):
        self.__init__(total)

    def print(self, current_index):
        flag = False
        while float(current_index) / self.total >= self.next_target / 50:
            flag = True
            sys.stdout.write("\u2588")
            self.next_target = self.next_target + 1
        if flag:
            sys.stdout.flush()

